package sshj.excelutil;

import conv.AssetBean;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * @Author Mu
 * @Date 2020/11/25 19:05
 */
public class ImportDataFromExcel {

    public static void export() {
        String filePath = "E:\\ns\\1.xls";
        POIFSFileSystem fs = null;
        HSSFWorkbook wb = null;
        try {
            InputStream inputStream = new FileInputStream(new File(filePath));
            fs = new POIFSFileSystem(inputStream);
            wb = new HSSFWorkbook(fs);
        } catch (IOException e) {
            e.printStackTrace();
        }

        ExcelReaderUtil exlceReaderUtil = new ExcelReaderUtil(fs, wb);

        List<AssetBean> beans = exlceReaderUtil.readExcelContent();

        exlceReaderUtil.export(beans);

    }


}
